package com.har.modules.business.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.har.common.utils.PageUtils;
import com.har.common.utils.Query;
import com.har.modules.business.dao.TBannerDao;
import com.har.modules.business.entity.TBannerEntity;
import com.har.modules.business.service.TBannerService;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service("tBannerService")
public class TBannerServiceImpl extends ServiceImpl<TBannerDao, TBannerEntity> implements TBannerService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {

        EntityWrapper<TBannerEntity> ew = new EntityWrapper<>();
        ew.orderBy("status DESC,update_time DESC");


        Page<TBannerEntity> page = this.selectPage(
                new Query<TBannerEntity>(params).getPage(),ew);
        return new PageUtils(page);
    }

}
